package com.holyant.goods.dto;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Objects;

/**
 * @author zgx *
 * @date 2022年12月26日 14:10
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class GdsSkuQuoteCombinationDto {



    private String code;


    private String skuCode;

    private Integer curType;

    private Integer quoteMethod;


    private LocalDate effectiveTimeStart;

    private LocalDate effectiveTimeEnd;

    private String priceObj;

    private LocalDateTime createTime;

    public JSONObject getSpecsPrice() {
        if (Objects.nonNull(priceObj)) {
            return JSON.parseObject(priceObj);
        }
        return new JSONObject();
    }
}
